<?php
namespace app\api\controller\com;
class Shopcat extends Base {

	//商户类型列表
	public function lists() {
		$d = $this->post();
		$rule = [];
		$msg = [];
		check($rule, $msg, $d);

		$map = [];
		$map[] = ["and", "status", "=", 0];

		$w = where($map);
		$order = "order by sort desc,id desc";
		$sql = "select * from shop_cat $w[0] {$order} ";
		$list = $this->db->query($sql, $w[1]);

		foreach ($list as $k => $v) {
			$list[$k]['create_time_name'] = com_time_format($v['create_time']);
			$list[$k]['text'] = $v['title'];
		}
		suc($list);

	}

}
